<%@ Page Language="C#" MasterPageFile="~/master/admin.master" AutoEventWireup="true"
    CodeFile="news-add.aspx.cs" Inherits="admin_news_add" Title="Untitled Page" %>

<%@ Register Assembly="FredCK.FCKeditorV2" Namespace="FredCK.FCKeditorV2" TagPrefix="FCKeditorV2" %>
<%@ Register Namespace="ECommerce.Library.Web" TagPrefix="ucc" %>
<%@ Register Src="~/controls/wucAdminValidator.ascx" TagName="AdminValidator" TagPrefix="wuc" %>
<%@ Register Src="~/controls/wucEmptyGridMessage.ascx" TagName="EmptyGridMessage"    TagPrefix="wuc" %>

<asp:Content ID="cntMiddleContent" ContentPlaceHolderID="cphMiddleContent" runat="Server">

    <script type="text/javascript" src="<%=rootPath %>thirdparty/date-picker/date-picker.js"></script>

    <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
            <td align="left" height="30" bgcolor="#f6f6f6" class="plnk" style="padding: 0 10px;">
                <a href="<%= AutoGear.BLL.CustomSiteMap.AdminHome %>">Dashboard</a> &raquo; <a href="<%= AutoGear.BLL.CustomSiteMap.NewsList %>">
                    News</a><a href="<%= AutoGear.BLL.CustomSiteMap.NewsAdd %>"> &raquo; Add News</a></td>
        </tr>
        <tr>
            <td height="10">
            </td>
        </tr>
        <tr>
            <td align="left" style="background: url(<%=rootPath %>images/admin/page-title-back.jpg);
                background-repeat: repeat-x;">
                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                        <td width="10" align="left">
                            <img src="<%=rootPath %>images/admin/page-title-left.jpg" width="5" height="30" alt=" " /></td>
                        <td align="left" class="rate">
                            <strong>Add News</strong></td>
                        <td width="10" align="right">
                            <img src="<%=rootPath %>images/admin/page-title-right.jpg" width="5" height="30"
                                alt=" " /></td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td align="center" style="padding: 10px;">
                <table cellpadding="5" cellspacing="5">
                    <tr>
                        <td>
                            <table width="100%" cellpadding="5" cellspacing="0" style="border: 1px solid #cacaca;">
                                <tbody>
                                    <tr>
                                        <td align="left" style="background-color: #f6f6f6">
                                        </td>
                                        <td align="right" style="background-color: #f6f6f6">
                                            <asp:ImageButton ID="imgSaveUp" runat="server" ImageUrl="~/images/admin/btn-save.jpg"
                                                AlternateText=" " Width="49px" Height="25px" OnClick="Create_Click" /></td>
                                    </tr>
                                    <tr>
                                        <td colspan="2" align="center">
                                            <ucc:ResponseMessage ID="uccResponseMessage" runat="server"></ucc:ResponseMessage>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="2" align="left">
                                            <asp:ValidationSummary ID="ValidationSummary1" runat="server" EnableClientScript="true"
                                                DisplayMode="BulletList" ShowMessageBox="true" HeaderText="Please correct the following:"
                                                CssClass="adminValidator" />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td style="width: 100px;" align="left">
                                            News Name</td>
                                        <td align="left">
                                            <asp:TextBox ID="tbxNewsName" runat="server" Width="230px" CssClass="txtbox"></asp:TextBox>
                                            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="tbxNewsName"
                                                ErrorMessage="News name is required" Display="dynamic" SetFocusOnError="true">
                                                <wuc:AdminValidator ID="AdminValidator1" runat="server" />
                                            </asp:RequiredFieldValidator>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="2" align="left">
                                            News Brief Description<div>
                                                <FCKeditorV2:FCKeditor ID="fckNewsBriefDescription" runat="server" BasePath="~/thirdparty/fckeditor/"
                                                    Width="900px" Height="250px">
                                                </FCKeditorV2:FCKeditor>
                                            </div>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="2" align="left">
                                            News Description<div>
                                                <FCKeditorV2:FCKeditor ID="fckNewsDescription" runat="server" BasePath="~/thirdparty/fckeditor/"
                                                    Width="900px" Height="350px">
                                                </FCKeditorV2:FCKeditor>
                                            </div>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td height="30" align="left">
                                            News Date:</td>
                                        <td align="left">
                                            <asp:TextBox ID="tbxNewsDate" runat="server" CssClass="txtbox"></asp:TextBox>
                                            <span class="red">*</span> <a href="#" onclick="javascript:displayDatePicker('<%= tbxNewsDate.ClientID %>');return false;">
                                                <img style="border: 0px none;" src="<%=rootPath %>images/calendar.gif" alt="" /></a>
                                            <asp:RequiredFieldValidator ID="rfvNewsDate" runat="server" ControlToValidate="tbxNewsDate"
                                                ErrorMessage="News Date is required" Display="dynamic" SetFocusOnError="true"
                                                EnableClientScript="true">
                                                <wuc:AdminValidator ID="Validator3" runat="server" />
                                            </asp:RequiredFieldValidator>
                                            <asp:RegularExpressionValidator runat="server" ID="revNewsDate" ControlToValidate="tbxNewsDate"
                                                EnableClientScript="true" ErrorMessage="Incorrect News Date Format" SetFocusOnError="true"
                                                ValidationExpression="^(0[1-9]|1[0-2])/(0[1-9]|[1-2][0-9]|3[01])/([1-9][0-9][0-9][0-9])$">
                                                <wuc:AdminValidator ID="Validator28" runat="server" />
                                            </asp:RegularExpressionValidator>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td align="left">
                                        </td>
                                        <td align="left" class="smallred">
                                            ( Format: mm/dd/yyyy )</td>
                                    </tr>
                                    <tr>
                                        <td align="left">
                                            Display Order</td>
                                        <td align="left">
                                            <asp:TextBox ID="tbxDisplayOrder" runat="server"></asp:TextBox>
                                            <asp:RequiredFieldValidator ID="rfvDisplayOrder" runat="server" ControlToValidate="tbxDisplayOrder"
                                                ErrorMessage="Display Order is required" Display="dynamic" SetFocusOnError="true">
                                                <wuc:AdminValidator ID="AdminValidator3" runat="server" />
                                            </asp:RequiredFieldValidator>
                                            <asp:RegularExpressionValidator runat="server" ID="revDisplayOrder" ControlToValidate="tbxDisplayOrder"
                                                EnableClientScript="true" ErrorMessage="Only number allowed" SetFocusOnError="true"
                                                ValidationExpression="^\d+$">
                                                <wuc:AdminValidator ID="Validator40" runat="server" />
                                            </asp:RegularExpressionValidator>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td align="left">
                                            Active</td>
                                        <td align="left">
                                            <asp:CheckBox ID="cbxIsActive" runat="server" />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="2">
                                            <table width="70%">
                                                <tr>
                                                    <td colspan="3" align="left">
                                                        <strong>Related News</strong></td>
                                                </tr>
                                                <tr>
                                                    <td align="left" valign="top">
                                                        <table border="0" cellspacing="0" cellpadding="0">
                                                            <tr>
                                                                <td>
                                                                    <asp:DropDownList ID="ddlRelatedList" runat="server">
                                                                    </asp:DropDownList></td>
                                                                <td>
                                                                    &nbsp;&nbsp;</td>
                                                                <td>
                                                                    <asp:Button runat="server" ID="btnAddRelated" CssClass="custombutton" Text="Add Related"
                                                                        OnClick="Add_Related_Items" />
                                                                </td>
                                                            </tr>
                                                        </table>
                                                    </td>
                                                    <td valign="top" align="right">
                                                        <asp:ImageButton ID="imbRemove" runat="server" ImageUrl="~/images/admin/btn-remove.gif"
                                                            AlternateText=" " Width="69px" Height="25px" OnClick="Delete_Related_Items" />
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td colspan="3" valign="top">
                                                        <asp:GridView ID="grvRelated" runat="server" AllowPaging="false" AllowSorting="false"
                                                            AutoGenerateColumns="false" PageSize="50" GridLines="none" CellPadding="7" CellSpacing="0"
                                                            Width="100%" OnRowDataBound="Related_RowDataBound">
                                                            <Columns>
                                                                <asp:TemplateField>
                                                                    <HeaderStyle Width="50%" HorizontalAlign="left" VerticalAlign="middle" CssClass="adminGridHeader" />
                                                                    <ItemStyle Width="50%" HorizontalAlign="left" VerticalAlign="middle" CssClass="adminGridRow" />
                                                                    <HeaderTemplate>
                                                                        News
                                                                    </HeaderTemplate>
                                                                    <ItemTemplate>
                                                                        <asp:HiddenField ID="hdfRelatedId" runat="server" Value='<%# Eval("NewsId") %>' />
                                                                        <asp:Label ID="lblNewsNamee" runat="server" Text='<%# Eval("NewsName") %>'></asp:Label>
                                                                    </ItemTemplate>
                                                                </asp:TemplateField>
                                                                <asp:TemplateField>
                                                                    <HeaderStyle Width="5%" HorizontalAlign="left" VerticalAlign="middle" CssClass="adminGridHeader" />
                                                                    <ItemStyle Width="5%" HorizontalAlign="left" VerticalAlign="middle" CssClass="adminGridRow" />
                                                                    <HeaderTemplate>
                                                                        <asp:CheckBox ID="cbxSelectAll" runat="server" />
                                                                    </HeaderTemplate>
                                                                    <ItemTemplate>
                                                                        <asp:CheckBox ID="cbxSelect" runat="server" />
                                                                    </ItemTemplate>
                                                                </asp:TemplateField>
                                                            </Columns>
                                                            <EmptyDataRowStyle HorizontalAlign="center" />
                                                            <EmptyDataTemplate>
                                                                <wuc:EmptyGridMessage ID="EmptyGridMessage1" runat="server" MessageText="No Realted News Found">
                                                                </wuc:EmptyGridMessage>
                                                            </EmptyDataTemplate>
                                                        </asp:GridView>
                                                    </td>
                                                </tr>
                                            </table>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td align="left" class="smallred" style="background-color: #f6f6f6">
                                        </td>
                                        <td align="right" style="background-color: #f6f6f6">
                                            <asp:ImageButton ID="imgSaveBottom" runat="server" ImageUrl="~/images/admin/btn-save.jpg"
                                                AlternateText=" " Width="49px" Height="25px" OnClick="Create_Click" /></td>
                                    </tr>
                                </tbody>
                            </table>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
</asp:Content>
